// Copyright (C) 2010  Andrew H. Chan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

///////////////////////////////////////////////////////
// Main source file for sampling probability program //
///////////////////////////////////////////////////////

#include "basic_functions.h"
#include "multiM.h"
#include "input_parser.h"
#include "compute.h"

using namespace std;

/////////////////////////
// begin main function //
/////////////////////////
int main(int argc, char** argv) {
    const char usage_message[] = "\nUsage: main <input_file_name>";
    if(argc < 2) {
        cout << usage_message << endl;
        return 1;
    }
    string file_name = argv[1];

    // input_parser.h parses the input file
    InputParser data;
    if(data.parse(file_name)) {
        cout << "Error while parsing input file." << endl;
        cout << "Exiting..." << endl;
        return 1;
    }
    // Compute is the class that does all the computations
    // The code is in compute.cpp. 
    Compute compute(data);
    compute.run();

    return 0;
}
